Begin with a simple program that reads in a filename from the command-line. 首先从一个简单的程序开始,该程序从命令行读入一个文件名。
The program in Listing 3 shows how to do that in Python: The code takes a tar filename as a command-line argument and then prompts the user with several options. 清单3中的程序说明了如何在Python中完成这项工作:这段代码接受一个tar文件的名称作为命令行参数,然后向用户提供几种选择。
This program gets a filename ( from the command-line, which it passes into the class's constructor), and then executes the following code 该程序取得文件名(从命令行获得并传递给类的构造函数),然后执行下面的代码
You will notice that this program takes two parameters: the filename and the longest delay one is willing to wait. 您将注意到这个程序采用两个参数:文件名和客户愿意等待的最长延迟。